<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/8 0008
 * Time: 上午 9:26
 */

require APPPATH."/models/DbCommon.php";

class User extends DbCommon
{
    function __construct()
    {
        parent::__construct();
    }

    static protected $table = "user_users";
    static function save($data,$where=''){
        if(!$where){
            return self::me()->db->insert(self::$table,$data);
        }else{
            return self::me()->db->update_string(self::$table, $data, $where);
        }
    }
    static function findByName($name,$password){
        return self::db()->where('name', $name)->where('password', $password)->get(self::$table)->row();
    }
    static function findByMobile($mobile,$password){
        return self::db()->where('mobile', $mobile)->where('password', $password)->get(self::$table)->row();
    }


}